function [ sorted ] = sortObjects( Blobs1, sortCriteria )
%SORTOBJECTS Summary of this function goes here
%   Detailed explanation goes here
	distances = [size(Blobs1,2),2];
            
    for k=1:size(Blobs1,2)
        blobBB2 = Blobs1(k).BoundingBox;
        
        if(sortCriteria <= 4)
            dis = blobBB2(sortCriteria);
        else
            switch(sortCriteria)
            case 5
                dis = blobBB2(3)*blobBB2(4);
            end
        end
        
        distances(k,1) = dis;
        distances(k,2) = k;
	end 
            
    sorted = sortrows(distances);
end

